package com.hongxun.budget.ui.dialog;

import android.view.View;

import com.hongxun.budget.R;
import com.hongxun.interfaces.ResponseListener;

/**
 * Created by admin on 2018/8/27.
 */

public class ImgClickDialog extends BaseBottomFragmentDialog implements View.OnClickListener {

    ResponseListener listener;

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_img_click;
    }

    @Override
    protected void initViews() {
        rootView.findViewById(R.id.paizao).setOnClickListener(this);
        rootView.findViewById(R.id.cancel).setOnClickListener(this);
        rootView.findViewById(R.id.xiangce).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.paizao:
                listener.response(1);
                break;
            case R.id.xiangce:
                listener.response(2);
                break;
            case R.id.cancel:
                break;
        }
        dismiss();
    }

    public ImgClickDialog setListener(ResponseListener listener) {
        this.listener = listener;
        return this;
    }
}
